package com.example.xss.commom.excetion;

import com.example.xss.commom.enums.IError;
import lombok.Getter;

/**
 * 自定义异常啊
 *
 * @author WANGJIET24
 * @date 2021-6-8$
 */
@Getter
public class ApiException extends RuntimeException{

    private final IError error;

    /**
     * Constructs a new runtime exception with {@code null} as its
     * detail message.  The cause is not initialized, and may subsequently be
     * initialized by a call to {@link #initCause}.
     */
    public ApiException(IError error) {
        super(error.getMessage());
        this.error = error;
    }
    public ApiException(String message) {
        super(message);
        this.error = null;
    }


}
